#!/bin/bash
# The following may be heavily borrowed from, if not 
# copied from, the NSA's December 20, 2007 "Guide to the 
# Secure Configuration of Red Hat Enterprise Linux 5, Revision 2"

# Title - Disable Mounting of Uncommon Filesystem Types

#Initialize variables
export PRECHECK="grep -P 'install\s(cramfs|freevxfs|jffs2|hfs|hfplus|squashfs|udf)\s/bin/true' /etc/modprobe.conf"
export QUESTION="Would you like to disable mounting of uncommon filesystem types"
export DESCRIPTION="It is good to prevent the usage of uncommon filesystem types on the system"
export SOLUTION="changeOrAdd '^install cramfs /bin/true' 'install cramfs /bin/true' /etc/modprobe.conf; \
changeOrAdd '^install\s+freevxfs.*' 'install freevxfs /bin/true' /etc/modprobe.conf; \
changeOrAdd '^install\s+jffs2.*' 'install jffs2 /bin/true' /etc/modprobe.conf; \
changeOrAdd '^install\s+hfs.*' 'install hfs /bin/true' /etc/modprobe.conf; \
changeOrAdd '^install\s+hfsplus.*' 'install hfsplus /bin/true' /etc/modprobe.conf; \
changeOrAdd '^install\s+squashfs.*' 'install squashfs /bin/true' /etc/modprobe.conf; \
changeOrAdd '^install\s+udf.*' 'install udf /bin/true' /etc/modprobe.conf;"



